;
; Adaptado para ser montado pelo SJASMPLUS. Unificado codigo do MSX2 e MSX2+
; Usado constantes para os numeros de portas de I/O
; por Fabio Belavenuto e Leonard Oliveira @ 2014
;

;	CNTRY	Country
;		0 = Japan
;		1 = USA
;		2 = International
;		3 = UK
;		4 = France
;		5 = Germany
;		6 = Italy
;		7 = Spain
;		8 = Arabic
;		9 = Korea
;		10 = Russia
;		11 = Brazil (Expert)
;		12 = Brazil (Hotbit)

CNTRY		= 11

;	CSPRFIX		(only MSX2)
;		0 = Use Cas/Printer bug
;		1 = Use bugfix

CSPRFIX	=	1

; splashscreen (boot logo)
;	2=logo MSX2/2+
;	3=Hotbit
;	4=
;	5=M5X
;
LOGO	= 2

; only MSX2+
OPTENT       = $7900		; optrom entrypoint (use $7800 or $7700 if necessary)
F4_NORMAL    = 0			; 0=F4 register inverted, 1=F4 register normal
OPT_WITH_FM  = 1			; 0=optrom without FM, 1=optrom with FM

;-------------------------------------------------------------------------------
; constants

MSX2KC_PORT	= $7E		; MSX 2 Key Cartridge
UART_PORT	= $80		; Serial port
PRT_PORT	= $90		; Printer port
VDP_PORT	= $98		; VDP
PSG_PORT	= $A0		; PSG
PPI_PORT	= $A8		; 8255
RTC_PORT	= $B4		; RTC
LIGPEN_PORT	= $B8		; lightpen
FM_AUDIO	= $C0		; MSX_Audio / MSX_Music
MSXIF_PORT	= $C8		; ?
KANJI1_PORT	= $D8		; Kanji
KANJI2_PORT	= $DA		; Kanji
SYS_PORT	= $F5		; MSX Engine configuration
AV_PORT		= $F7		; A/V Port (Digitilizer)
MAPPER_PORT	= $FC		; Mapper controller
F3_PORT		= $F3		; ??
BOOT_PORT	= $F4		; Common inverted RESET status



;	symbols used to procedure alternate code

;	INTHZ 	interrupt frequency
;	CHRGEN	character generator
; 		0 = japanese
;		1 = international
;		2 = USSR ??
;	DATFMT	date format
; 		0 = Y-M-D
; 		1 = M-D-Y
;		2 = D-M-Y
;	KEYTYP	keyboard layout
;		0 = Japanese 
;		1 = International (QWERTY/other) 
;		2 = French (AZERTY) 
;		3 = English 
;		4 = German (DIN)
;		5 = USSR
;		6 = Spanish
;		7 = Swedish ??
;		8 = Brazilian Expert
;		9 = Brazilian Hotbit
;	BASVER
;		0 = Japanese
;		1 = International

	IF	CNTRY = 0

; Japanese MSX settings

INTHZ		= 60
CHRGEN		= 0
DATFMT		= 0
KEYTYP		= 0
BASVER		= 0

	ENDIF

	IF	CNTRY = 1

; USA MSX settings

INTHZ		= 60
CHRGEN		= 1
DATFMT		= 1
KEYTYP		= 1
BASVER		= 1

	ENDIF

	IF	CNTRY = 2

; International MSX settings

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 1
KEYTYP		= 1
BASVER		= 1

	ENDIF

	IF	CNTRY = 3

; UK MSX settings

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 3
BASVER		= 1

	ENDIF

	IF	CNTRY = 4

; French MSX settings

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 2
BASVER		= 1

	ENDIF

	IF	CNTRY = 5

; German MSX settings

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 4
BASVER		= 1

	ENDIF

	IF	CNTRY = 6

; Italian MSX settings
; Dateformat is not sure

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 1
BASVER		= 1

	ENDIF

	IF	CNTRY = 7

; Spanish MSX settings

INTHZ		= 50
CHRGEN		= 1
DATFMT		= 1
KEYTYP		= 6
BASVER		= 1

	ENDIF

	IF	CNTRY = 8

; Arabic MSX settings
; Unknown

INTHZ		= 60
CHRGEN		= 0
DATFMT		= 0
KEYTYP		= 0
BASVER		= 0

	ENDIF

	IF	CNTRY = 9

; Korean MSX settings

INTHZ		= 60
CHRGEN		= 0
DATFMT		= 0
KEYTYP		= 0
BASVER		= 0

	ENDIF

	IF	CNTRY = 10

; Russian MSX settings

INTHZ		= 60
CHRGEN		= 2
DATFMT		= 1
KEYTYP		= 5
BASVER		= 1

	ENDIF

	IF	CNTRY = 11

; Brazilian Expert MSX settings

INTHZ		= 60
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 8
BASVER		= 1

	ENDIF

	IF	CNTRY = 12

; Brazilian Hotbit MSX settings

INTHZ		= 60
CHRGEN		= 1
DATFMT		= 2
KEYTYP		= 9
BASVER		= 1

	ENDIF



	IF	BASVER = 0
CHRCUR		= $5C			; yen sign
CHRFLN		= "&"
CHRVLN		= "@"
	ENDIF

	IF	(BASVER = 1) AND (CNTRY != 3)
CHRCUR		= "$"
CHRFLN		= "\\"
CHRVLN		= "&"
	ELSE
CHRCUR		= $AC			; pound sign
CHRFLN		= "\\"
CHRVLN		= "&"
	ENDIF


; Splashscreen logo constants

 IF	LOGO = 2
	DEFINE	LOGO_FILE		"logo-msx.inc"
	DEFINE	LEFTBORDER		240
	DEFINE	RIGHTBORDER		255
	DEFINE	YDEST			32
	DEFINE	XDEST			45
	DEFINE	ANTIALIASING	1
	DEFINE	LOGOWIDTH		422
 ENDIF

 IF	LOGO = 3
	DEFINE	LOGO_FILE		"logo-hotbit.inc"
	DEFINE	LEFTBORDER		240
	DEFINE	RIGHTBORDER		255
	DEFINE	YDEST			32
	DEFINE	XDEST			45
	DEFINE	ANTIALIASING	1
	DEFINE	LOGOWIDTH		422
 ENDIF

 IF	LOGO = 5
	DEFINE	LOGO_FILE		"logo-m5x.inc"
	DEFINE	LEFTBORDER		240
	DEFINE	RIGHTBORDER		255
	DEFINE	YDEST			32
	DEFINE	XDEST			45
	DEFINE	ANTIALIASING	1
	DEFINE	LOGOWIDTH		422
 ENDIF

